{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { WEEK_DAY_COUNT, getWeekStartDate, isSameDate, isSameMonth, formatValue } from \"../../utils/dateUtil\";\nimport RangeContext from \"../../RangeContext\";\nimport useCellClassName from \"../../hooks/useCellClassName\";\nimport PanelBody from \"../PanelBody\";\nfunction DateBody(props) {\n  var prefixCls = props.prefixCls,\n    generateConfig = props.generateConfig,\n    prefixColumn = props.prefixColumn,\n    locale = props.locale,\n    rowCount = props.rowCount,\n    viewDate = props.viewDate,\n    value = props.value,\n    dateRender = props.dateRender;\n  var _React$useContext = React.useContext(RangeContext),\n    rangedValue = _React$useContext.rangedValue,\n    hoverRangedValue = _React$useContext.hoverRangedValue;\n  var baseDate = getWeekStartDate(locale.locale, generateConfig, viewDate);\n  var cellPrefixCls = \"\".concat(prefixCls, \"-cell\");\n  var weekFirstDay = generateConfig.locale.getWeekFirstDay(locale.locale);\n  var today = generateConfig.getNow(); // ============================== Header ==============================\n\n  var headerCells = [];\n  var weekDaysLocale = locale.shortWeekDays || (generateConfig.locale.getShortWeekDays ? generateConfig.locale.getShortWeekDays(locale.locale) : []);\n  if (prefixColumn) {\n    headerCells.push( /*#__PURE__*/React.createElement(\"th\", {\n      key: \"empty\",\n      \"aria-label\": \"empty cell\"\n    }));\n  }\n  for (var i = 0; i < WEEK_DAY_COUNT; i += 1) {\n    headerCells.push( /*#__PURE__*/React.createElement(\"th\", {\n      key: i\n    }, weekDaysLocale[(i + weekFirstDay) % WEEK_DAY_COUNT]));\n  } // =============================== Body ===============================\n\n  var getCellClassName = useCellClassName({\n    cellPrefixCls: cellPrefixCls,\n    today: today,\n    value: value,\n    generateConfig: generateConfig,\n    rangedValue: prefixColumn ? null : rangedValue,\n    hoverRangedValue: prefixColumn ? null : hoverRangedValue,\n    isSameCell: function isSameCell(current, target) {\n      return isSameDate(generateConfig, current, target);\n    },\n    isInView: function isInView(date) {\n      return isSameMonth(generateConfig, date, viewDate);\n    },\n    offsetCell: function offsetCell(date, offset) {\n      return generateConfig.addDate(date, offset);\n    }\n  });\n  var getCellNode = dateRender ? function (date) {\n    return dateRender(date, today);\n  } : undefined;\n  return /*#__PURE__*/React.createElement(PanelBody, _extends({}, props, {\n    rowNum: rowCount,\n    colNum: WEEK_DAY_COUNT,\n    baseDate: baseDate,\n    getCellNode: getCellNode,\n    getCellText: generateConfig.getDate,\n    getCellClassName: getCellClassName,\n    getCellDate: generateConfig.addDate,\n    titleCell: function titleCell(date) {\n      return formatValue(date, {\n        locale: locale,\n        format: 'YYYY-MM-DD',\n        generateConfig: generateConfig\n      });\n    },\n    headerCells: headerCells\n  }));\n}\nexport default DateBody;","map":{"version":3,"names":["_extends","React","WEEK_DAY_COUNT","getWeekStartDate","isSameDate","isSameMonth","formatValue","RangeContext","useCellClassName","PanelBody","DateBody","props","prefixCls","generateConfig","prefixColumn","locale","rowCount","viewDate","value","dateRender","_React$useContext","useContext","rangedValue","hoverRangedValue","baseDate","cellPrefixCls","concat","weekFirstDay","getWeekFirstDay","today","getNow","headerCells","weekDaysLocale","shortWeekDays","getShortWeekDays","push","createElement","key","i","getCellClassName","isSameCell","current","target","isInView","date","offsetCell","offset","addDate","getCellNode","undefined","rowNum","colNum","getCellText","getDate","getCellDate","titleCell","format"],"sources":["/data/messenger.client/node_modules/rc-picker/es/panels/DatePanel/DateBody.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { WEEK_DAY_COUNT, getWeekStartDate, isSameDate, isSameMonth, formatValue } from \"../../utils/dateUtil\";\nimport RangeContext from \"../../RangeContext\";\nimport useCellClassName from \"../../hooks/useCellClassName\";\nimport PanelBody from \"../PanelBody\";\n\nfunction DateBody(props) {\n  var prefixCls = props.prefixCls,\n      generateConfig = props.generateConfig,\n      prefixColumn = props.prefixColumn,\n      locale = props.locale,\n      rowCount = props.rowCount,\n      viewDate = props.viewDate,\n      value = props.value,\n      dateRender = props.dateRender;\n\n  var _React$useContext = React.useContext(RangeContext),\n      rangedValue = _React$useContext.rangedValue,\n      hoverRangedValue = _React$useContext.hoverRangedValue;\n\n  var baseDate = getWeekStartDate(locale.locale, generateConfig, viewDate);\n  var cellPrefixCls = \"\".concat(prefixCls, \"-cell\");\n  var weekFirstDay = generateConfig.locale.getWeekFirstDay(locale.locale);\n  var today = generateConfig.getNow(); // ============================== Header ==============================\n\n  var headerCells = [];\n  var weekDaysLocale = locale.shortWeekDays || (generateConfig.locale.getShortWeekDays ? generateConfig.locale.getShortWeekDays(locale.locale) : []);\n\n  if (prefixColumn) {\n    headerCells.push( /*#__PURE__*/React.createElement(\"th\", {\n      key: \"empty\",\n      \"aria-label\": \"empty cell\"\n    }));\n  }\n\n  for (var i = 0; i < WEEK_DAY_COUNT; i += 1) {\n    headerCells.push( /*#__PURE__*/React.createElement(\"th\", {\n      key: i\n    }, weekDaysLocale[(i + weekFirstDay) % WEEK_DAY_COUNT]));\n  } // =============================== Body ===============================\n\n\n  var getCellClassName = useCellClassName({\n    cellPrefixCls: cellPrefixCls,\n    today: today,\n    value: value,\n    generateConfig: generateConfig,\n    rangedValue: prefixColumn ? null : rangedValue,\n    hoverRangedValue: prefixColumn ? null : hoverRangedValue,\n    isSameCell: function isSameCell(current, target) {\n      return isSameDate(generateConfig, current, target);\n    },\n    isInView: function isInView(date) {\n      return isSameMonth(generateConfig, date, viewDate);\n    },\n    offsetCell: function offsetCell(date, offset) {\n      return generateConfig.addDate(date, offset);\n    }\n  });\n  var getCellNode = dateRender ? function (date) {\n    return dateRender(date, today);\n  } : undefined;\n  return /*#__PURE__*/React.createElement(PanelBody, _extends({}, props, {\n    rowNum: rowCount,\n    colNum: WEEK_DAY_COUNT,\n    baseDate: baseDate,\n    getCellNode: getCellNode,\n    getCellText: generateConfig.getDate,\n    getCellClassName: getCellClassName,\n    getCellDate: generateConfig.addDate,\n    titleCell: function titleCell(date) {\n      return formatValue(date, {\n        locale: locale,\n        format: 'YYYY-MM-DD',\n        generateConf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